//
// Description: 5203. 统计可以提取的工件
// Created by Loading on 2022/3/13.
//

#include <bits/stdc++.h>

using namespace std;

int digArtifacts(int n, vector<vector<int>> &artifacts, vector<vector<int>> &dig) {
    // 挖掘数组，将挖掘的单元格置为 1
    vector<vector<int>> vec(n, vector<int>(n));
    for (auto v : dig) {
        vec[v[0]][v[1]] = 1;
    }

    int res = 0;
    for (auto v : artifacts) {
        for (int i = v[0]; i <= v[2]; ++i) {
            for (int j = v[1]; j <= v[3]; ++j) {
                if (vec[i][j] != 1) {
                    // 存在某个单元格未挖掘
                    goto next;
                }
            }
        }
        ++res;
        next:;
    }
    return res;
}

int main() {
    int n = 2;
    vector<vector<int>> artifacts{{0, 0, 0, 0},
                                  {0, 1, 1, 1}};
    vector<vector<int>> dig{{0, 0},
                            {0, 1}};
    int res = digArtifacts(n, artifacts, dig);
    cout << res << endl;

    return 0;
}